<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>生成器函数参数</title>
</head>
<body>
    <script>
        function * gen(){
           let one =  yield 111;
           console.log(one);
           let two = yield 222;
           console.log(two);
           let thrid = yield 333;
           console.log(thrid);
        }
        //执行获取迭代器
        let it = gen();
        console.log(it.next());
        console.log(it.next("aaa"));
        console.log(it.next("bbb"));
        console.log(it.next("ccc"));
    </script>
</body>
</html>